<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/manage/common/taglibs.jsp"%>

<script type="text/javascript">

/**
 * 修改密码
 */
function manage_user_changePasswd(id){
	$('#manage_user_datagrid').datagrid('uncheckAll').datagrid('unselectAll').datagrid('clearSelections');
	$('<div/>').dialog({
		href : '${pageContext.request.contextPath}/manage/system/user/showChangePassword.html?id='+id,
		width : 400,
		height : 200,
		modal : true,
		title : '修改用戶密碼',
		buttons : [ {
			text : '修改',
			iconCls : 'icon-edit',
			handler : function() {
				var d = $(this).closest('.window-body');
				$('#manage_user_changePassword_form').form('submit', {
					onSubmit:function(){
						return manage_user_changePassword_form_onSubmit();
					},					
					success : function(data) {
						try {
							var result = $.parseJSON(data);
							if (result.success) {
								d.dialog('destroy');
							}
							$.messager.show({
								title : '提示',
								msg : result.message
							});
						} catch (e) {
							$.messager.alert('提示', result);
						}
					}
				});
			}
		} ],
		onClose : function() {
			$(this).dialog('destroy');
		}
	});	
}



/**
 * 页面加载完成后执行
 */
$(function() {
	//注册按键回车直接提交查询
	$.acooly.framework.registerKeydown('manage_user_searchform','manage_user_datagrid');
});
</script>



<div class="easyui-layout" data-options="fit : true,border : false">
  <!-- 查询条件 -->
  <div data-options="region:'north',border:false" style="height: 40px; overflow: hidden;" align="left">
    <form id="manage_user_searchform">
      <table class="tableForm">
        <tr>
          <td align="left">登录名:<input type="text" size="10" name="search_LIKE_loginid" /> 姓名:<input type="text" size="10" name="search_LIKE_name" /> 创建时间:<input name="createdatetimeStart"
            size="15" onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" />至<input name="createdatetimeEnd" size="15"
            onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" /> 
                    状态:<select id="search_EQ_status" name="search_EQ_status" panelHeight="auto" class="easyui-combobox" style="width:50px;">
              <option value="">所有</option>
              <c:forEach items="${allStatus}" var="e">
                <option value="${e.key}">${e.value}</option>
              </c:forEach>
          </select> 类型:<select id="search_EQ_userType" name="search_EQ_userType" panelHeight="auto" class="easyui-combobox" style="width:80px;">
              <option value="">所有</option>
              <c:forEach items="${allUserTypes}" var="e">
                <option value="${e.key}">${e.value}</option>
              </c:forEach>
          </select> 
          <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="$.acooly.framework.search('manage_user_searchform','manage_user_datagrid');">查询</a> 
          </td>
        </tr>
      </table>
    </form>
  </div>

  <!-- 列表和工具栏 -->
  <div data-options="region:'center',border:false">
    <table id="manage_user_datagrid" class="easyui-datagrid" url="${pageContext.request.contextPath}/manage/system/user/listJson.html" toolbar="#manage_user_toolbar" fit="true" border="false" fitColumns="true"
      pagination="true" idField="id" pageSize="20" pageList="[ 10, 20, 30, 40, 50 ]" sortName="id" sortOrder="desc" checkOnSelect="true" selectOnCheck="true">
      <thead>
        <tr>
          <th field="userId" checkbox="true" data-options="formatter:function(value, row, index){ return row.id }">编号</th>
          <th field="id" sortable="true" width="40">编号</th>
          <th field="loginid" width="100">登录名称</th>
          <th field="name" width="100">姓名</th>        
          <th field="createTime" formatter="formatDate" width="100">创建时间</th>
          <th field="email" width="100">E-mail</th>
          <th field="roles" width="100" data-options="formatter:function(value){ return value?value[0]['name']:'';}">角色</th>
          <th field="status" width="50" data-options="formatter:function(value){ return formatRefrence('manage_user_datagrid','allStatus',value);} ">状态</th>
          <th field="userType" width="50" data-options="formatter:function(value){ return formatRefrence('manage_user_datagrid','allUserTypes',value);} ">用户类型</th>
          <th field="action" width="100" data-options="formatter:function(value, row, index){return formatAction('manage_user_action',value,row)}">动作</th>
        </tr>
      </thead>
    </table>
    
    <div id="manage_user_action" style="display: none;">
      <a onclick="$.acooly.framework.edit({url:'/manage/system/user/edit.html',id:{0},entity:'user',height:350});" href="#"><img title="编辑" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/edit.png" border="0"/></a>
      <a onclick="$.acooly.framework.show('/manage/system/user/show.html?id={0}',500,350);" href="#"><img title="查看" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/show.png" border="0"/></a>
      <a onclick="manage_user_changePasswd({0});" href="#"><img title="修改密码" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/edit_pswd.png" border="0"/></a>
      <a onclick="$.acooly.framework.remove('/manage/system/user/deleteJson.html',{0},'manage_user_datagrid');" href="#"><img title="删除" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/delete.png" border="0"/></a>
    </div>
    
    <div id="manage_user_toolbar">
      <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="$.acooly.framework.create({url:'/manage/system/user/create.html',entity:'user',height:430})">添加</a> 
      <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="framework_removes('/manage/system/user/deleteJson.html','manage_user_datagrid')">批量删除</a>
      <a href="#" class="easyui-menubutton" data-options="menu:'#manage_user_exports_menu',iconCls:'icon-export'">批量导出</a>
      <div id="manage_user_exports_menu" style="width:150px;">
        <div data-options="iconCls:'icon-excel'" onclick="$.acooly.framework.exports('/manage/system/user/exportXls.html','manage_user_searchform','用戶信息')">Excel</div>  
        <div data-options="iconCls:'icon-csv'" onclick="$.acooly.framework.exports('/manage/system/user/exportCsv.html','manage_user_searchform','用戶信息')">CSV</div> 
      </div> 
    </div>
  </div>

</div>
